<?php
namespace Home\Controller;

class OnlineController extends HomeController {
 

   public function index(){
        $video = M('Live')->where(array('status'=>'1'))->select();
        $size = sizeof($video)/5;
        $this->assign('size',ceil($size));
        $this->assign('video',$video);
        $this->display();
	}

    public function detail($id = null){
        if ($id == null){
            $this->error('视频id错误');
        }else{
            $video = M('Live')->where(array('id' => $id))->find();

            $this->assign('video',$video);
            $this->display();
        }
    }

}